package fair.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import fair.mapper.UserClassMapper;
import fair.mapper.WorkClassMapper;
import fair.pojo.UserClass;
import fair.pojo.WorkClass;
import fair.service.IUserClassService;
import fair.service.IWorkClassService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户班级中间表 服务实现类
 * </p>
 *
 * @author fair
 * @since 2021-03-04
 */
@Slf4j
@Transactional
@Service(interfaceClass = IWorkClassService.class, version = "${dubbo.service.core.version}", group = "${dubbo.service.core.group}", retries = -1)
public class WorkClassServiceImpl extends ServiceImpl<WorkClassMapper, WorkClass> implements IWorkClassService {

    @Autowired
    private WorkClassMapper workClassMapper;

    @Override
    public List<WorkClass> findByClassId(Integer classId) {
        Map<String, Object> map = new HashMap<>();
        map.put("class_id", classId);
        return workClassMapper.selectByMap(map);
    }
}
